{% extends 'system_template/public/base_main.html' %}
{% block cite %}
    友情管理中心
{% endblock %}
{% block content %}
    <div class="layui-card-header">
        <button class="layui-btn layui-btn-danger" onclick="checkbox(this,'DELETES')">
            <i class="layui-icon"></i>批量删除
        </button>
        <button class="layui-btn layui-btn-normal" onclick="tl_cms.open('添加链接','{{ url_for('sys_bp.blogroll') }}',700,500)">
            <i class="layui-icon"></i>添加
        </button>
    </div>
    <table class="layui-table layui-form">
        <thead>
        <tr>
            <th>
                <input type="checkbox" name="" lay-skin="primary" lay-filter="c_all">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i
                        class="layui-icon layui-icon-ok"></i></div>
            </th>
            <th>链接名称</th>
            <th>链接URL</th>
            <th>创建时间</th>
            <th>到期时间</th>
            <th>备注信息</th>
            <th>链接状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {% for data in data_list %}
         <tr>
            <td>
                <input type="checkbox" name="" lay-skin="primary" value="{{ data.id }}">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary">
                    <i class="layui-icon layui-icon-ok"></i>
                </div>
            </td>
            <td>{{ data.link_name }}</td>
            <td>{{ data.link_url }}</td>
            <td>{{ data.update_time }}</td>
            <td>{{ data.link_end_date }}</td>
             <td>{{ data.link_remark }}</td>
            <td>{{ data.status|status }}</td>
            <td class="td-manage">
                <a class="but_sm" title="修改" onclick="tl_cms.open('编辑','{{ url_for('sys_bp.blogroll_edit',id=data.id) }}')" href="javascript:;">
                    修改</a>
                <a class="but_sm del_but" title="删除" onclick="del(this,'{{ data.id }}')" href="javascript:;">
                    删除</a>
            </td>
        </tr>
        {% endfor %}
        </tbody>
    </table>


    {% if page.pages>1 %}
    <div class="layui-card-body ">
        <div class="page">
            <div>
            <a {% if page.has_prev %}class="next" href="?page={{ page.prev_num }}" {% else %}class="layui-btn-disabled"{% endif %}>上一页</a>
                {% for pg in page.iter_pages(2,2,2,2) %}
                    {% if page.page==pg %}
                        <span class="current">{{ pg }}</span>
                    {% else %}
                        {% if pg %}
                        <a class="num" href="?page={{ pg }}">{{ pg }}</a>
                        {% endif %}
                    {% endif %}
                {% endfor %}
            {% if not page.pages==page.page %}
            <a class="num" href="?page={{ page.pages }}">最后一页</a>
                {% endif %}
                <a {% if page.has_next %}class="next" href="?page={{ page.next_num }}" {% else %}class="layui-btn-disabled"{% endif %}>下一页</a>
            </div>
        </div>
    </div>
    {% endif %}
{% endblock %}
